import React from 'react';
import { Form } from 'antd';
import { AxUpdateForm } from '@/components/AxForm/AxUpdateForm';
import { AxInput, AxLabel, AxSelectEnum, AxSelectSearch, AxTextArea } from '@/components/AxForm/AxFormItem';

const Index: React.FC<any> = props => {
    const { form, values, ...rest } = props;

    return (
        <>
            <AxUpdateForm
                form={form}
                title={`修改采购主体 - ${values.name}`}
                values={values}
                {...rest}
                items={[
                    <AxInput
                        form={form}
                        label="采购主体名称"
                        field="name"
                        value={values.name}
                        required
                    />,
                    <AxInput
                        form={form}
                        label="采购主体英文名"
                        field="englishName"
                        value={values.englishName}
                        required
                    />,
                    <AxInput
                        form={form}
                        label="采购主体编码"
                        field="code"
                        value={values.code}
                        required
                    />,
                    <AxSelectEnum
                        form={form}
                        label="管控级别"
                        field="catalogType"
                        enumName='catalogType'
                        value={values.catalogType}
                        required
                    />,
                    <AxTextArea
                        form={form}
                        label="备注"
                        field="remark"
                        value={values.remark}
                        required
                    />,
                ]}
            />
        </>
    );
};

export default Form.create<any>()(Index);
